package com.example.mybatisplus.mapper;

import com.example.mybatisplus.model.domain.BedManagment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import com.example.mybatisplus.model.vo.StatVO;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ablbb
 * @since 2024-07-18
 */
public interface BedManagmentMapper extends BaseMapper<BedManagment> {
    @Insert({
            "<script>",
            "INSERT INTO bed_managment (room_id, building_id, room_number, floor, bed_number, is_enabled, price, digit, prefix, is_deleted, url)",
            "VALUES ",
            "<foreach collection='list' item='item' separator=','>",
            "(#{item.roomId}, #{item.buildingId}, #{item.roomNumber}, #{item.floor}, #{item.bedNumber}, #{item.enabled}, #{item.price}, #{item.digit}, #{item.prefix}, #{item.deleted}, #{item.url})",
            "</foreach>",
            "</script>"
    })
    void insertBatch(@Param("list") List<BedManagment> list);

    List<StatVO> statbed();
}
